using DG.Tweening;
using DG.Tweening.Core;
using UnityEngine;
using UnityEngine.UI;

namespace WorkFlow.Games.GrowthIsland.Scripts.Other
{
    public class GraphicAlphaTween : TweenGo.TweenGoBase<Graphic,float>
    {

        protected override Tweener CreateTween(DOGetter<float> startValueGetter, DOSetter<float> setter, float endValue, float duration)
        {
            return DOTween.To(startValueGetter, SetValue, endValue, duration);
        }

        protected override void SetValue(float value)
        {
            Color color = Target.color;
            color.a = value;
            Target.color = color;
        }
    }
}
